This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Mar 19, 2012, 6:46 PM
12 Posts

open Notes document from button event

  • Category: Other
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 0
I have an application where the user can click a button in an XPage to create documents in other Notes databases.
 
 Currently the way I'm doing it is:
1) SSJS button onclick event creates a Notes document in the current database and opens this document using "facesContext.getExternalContext().redirect(url); the url [produced by doc.getUrl()] is something like "notes:///__C1257958003322E2.nsf/0/15D79BA663BF6044C12579C6003DECCA?OpenDocument"
2) document form contains the code to trigger an agent that does the work and finally opens the newly created document in external Notes db
  
It works to certain extent, but...
 
If the button event's "server options" = "Full update":
...  .redirect(url) will open the Notes document in another tab (OK), but leaves the initial XPage tab blank (not OK).
 
If "server options" = "No update": XPage does not change (OK). If my db is on server, the Notes document opens(OK). However if I use a local replica, the code will open the last used Notes database instead of the doc referenced by notes url (not OK).
 
If I paste the same notes url in the Notes address bar, it opens the document either locally or on server, if I put it as a link on XPage it opens the document correctly (locally or on server).
 
However I cannot pre-calculate the link as I create the document only if the user clicks the button. Or if I use a fixed link to some existing Notes document (I cannot use notes link to agent, as it does not work, right?), I still need a way to tell the target document the action context (as the code in form will need create the document).
 
I need some extra trick. Any ideas?
 
 Edited: I ended up using partial refresh that computes a JS pointing to the url of the just created document and AJAX onComplete event to open Notes document using a simple UI call: window.open("notes://...."). This seem to work in all circumstances.

 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal